import 'dart:io';

/// url_util.dart
///
/// Created by fuchuanwei on Tue Feb 21 2023.
///
/// Description: url 工具类
///

///判断是否为网络地址
bool isRemote(String url) {
  var remoteUrlPattern = RegExp(r'^(https?:)?//');
  return remoteUrlPattern.hasMatch(url);
}

///判断是否为文件地址
bool isFileUrl(String url) {
// 使用File类尝试打开文件
  var file = File(url);
  try {
    file.openSync();
    return true;
  } catch (_) {
    return false;
  }
}
